
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.Security;

import org.bouncycastle.jce.provider.BouncyCastleProvider;

public class BouncyCastle {
    public static void main(String[] args){
        //test1();
        System.out.println("125");
    }
    static void test1(){
        //注册BouncyCastle
        Security.addProvider(new BouncyCastleProvider());
        //按名称正常调用
        try{
            MessageDigest md=MessageDigest.getInstance("RipeMD160");
        md.update("HelloWorld".getBytes("UTF-8"));
        byte[] result=md.digest();
        System.out.println(new BigInteger(1,result).toString(16));
        }
        catch(NoSuchAlgorithmException e){
            System.out.println("没有RipeMD160算法");
        }
        catch(UnsupportedEncodingException e){
            System.out.println("不支持UTF-8编码");
        }
    }
}
